package com.thread;

/**
 * Created by john on 2016/4/5.
 */
public class UnsynhchronizedThreadTest2 extends  Thread {

    private int count = 30;

    public UnsynhchronizedThreadTest2(String name){
        super();
        this.setName(name);
    }
    @Override
    public void run() {
        while(count > 0){
            count --;
            System.out.println("由线程"+Thread.currentThread().getName()+"计算，count="+count);
        }
    }

    public static void main(String[] args) {
        UnsynhchronizedThreadTest2 t1 = new UnsynhchronizedThreadTest2("A");
        UnsynhchronizedThreadTest2 t2 = new UnsynhchronizedThreadTest2("B");
        UnsynhchronizedThreadTest2 t3 = new UnsynhchronizedThreadTest2("C");
        t1.start();
        t2.start();
        t3.start();


    }
}

